<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:s="http://www.sensap.eu/jsf"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:dialogs="http://java.sun.com/jsf/composite/components/dialogs"
	xmlns:widgets="http://java.sun.com/jsf/composite/components/widgets"
	xmlns:shiro="http://shiro.apache.org/tags">

<f:view contentType="text/html">
	<h:head>
		<meta content='text/html; charset=UTF-8' http-equiv="Conmenutent-Type" />
		<h:outputStylesheet library="css" name="core.css" />
		<h:outputScript library="js" name="core.js" />
		<title>#{messages.UI_REQUEST_PRESENTATION_TITLE}</title>
	</h:head>

	<h:body styleClass="login" id="body">
		<h:form id="util">
			<p:growl widgetVar="growl" escape="false" autoUpdate="true"
				showSummary="false" showDetail="true" sticky="false" life="3000" />
		</h:form>

		<pe:blockUI widgetVar="windowBlockUI"
			targetSelector=".login">
			<span class="ui-icon-loader-big"></span>
		</pe:blockUI>

		<div align="center">
			<div class="logo" />
			<div class="slogan">Open Source Solution for the Internet of
				Things into the Cloud</div>
		</div>

		<p:separator />

		
		<p:outputPanel layout="block" style="text-align:center;">
			<h:button value="#{messages.UI_LOGIN_REQUEST_PRESENTATION}" outcome="requestPresentation.xhtml" />
			<ui:remove>
			<shiro:guest>
				<h:button value="Log out of CAS" onclick="window.open('#{loginPageController.signOutOfCASLink}', '_blank');"/>
			</shiro:guest>
			</ui:remove>
		</p:outputPanel>

		<ui:remove>
		<p:outputPanel layout="block" style="text-align:center;">
			<h:panelGrid columns="2"
				style="margin:0 auto;"
				cellpadding="20"
				columnClasses="align-top, align-top">
				<p:panel header="#{messages.UI_LOGIN_LOGIN_BUTTON}" style="width:250px;">
					<h:form>
						<h:panelGrid columns="2">
							<p:outputLabel value="#{messages.UI_LOGIN_EMAIL}" />
							<p:inputText value="#{loginPageController.context.email}" />

							<p:outputLabel value="#{messages.UI_LOGIN_PASSWORD}" />
							<p:inputText type="password"
								value="#{loginPageController.context.password}" />
						</h:panelGrid>
						<hr />
						<p:outputPanel layout="block" style="text-align:right;">
							<p:commandButton process="@form" update="@form"
								actionListener="#{loginPageController.handleLogin()}"
								value="#{messages.UI_LOGIN_LOGIN_BUTTON}" 
								onclick="windowBlockUI.block();"
								oncomplete="windowBlockUI.unblock();"/>
						</p:outputPanel>
					</h:form>
				</p:panel>

			</h:panelGrid>
		</p:outputPanel>
		</ui:remove>

		<p:dialog></p:dialog>
	</h:body>

</f:view>
</html>

